{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "1b9c432f",
   "metadata": {},
   "source": [
    "### 课后作业（第二章）\n",
    "> 1.第二章P93 前的所有项目练习(下周讲）  \n",
    "> 2.购物车项目  \n",
    ">> 要求：  \n",
    ">> 1.运行程序后，让用户输入支付宝余额，然后打印我们的商品列表给用户。  \n",
    ">> 2.让用户输入商品编号进行商品的购买。  \n",
    ">> 3.用户选择商品后，检查用户的余额是否够，若够则直接扣款，不够则提醒用户。  \n",
    ">> 4.用户可以随时退出购买，推出时打印用户已购买的商品和支付宝余额。  \n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "7c7e20cf",
   "metadata": {},
   "source": [
    "* 1.第二章P93 前的所有项目练习"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "fab362ef",
   "metadata": {},
   "outputs": [
    {
     "ename": "IndentationError",
     "evalue": "unexpected indent (1433761048.py, line 3)",
     "output_type": "error",
     "traceback": [
      "\u001b[1;36m  Input \u001b[1;32mIn [1]\u001b[1;36m\u001b[0m\n\u001b[1;33m    print(phrase)\u001b[0m\n\u001b[1;37m    ^\u001b[0m\n\u001b[1;31mIndentationError\u001b[0m\u001b[1;31m:\u001b[0m unexpected indent\n"
     ]
    }
   ],
   "source": [
    "phrase = \"Don't panic!\"\n",
    "plist = list(phrase)\n",
    " print(phrase) \n",
    "    print(plist)\n",
    "for i in range(4):\n",
    "    plist.pop()\n",
    "plist.pop(0)\n",
    "plist.remove(\"'\")\n",
    "plist.extend([plist.pop(), plist.pop()])\n",
    "plist.insert(2, plist.pop(3))\n",
    "new_phrase = ''.join(plist)\n",
    " print(plist)\n",
    "    print(new_phrase)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "570ac278",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "64e1e26a",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "e25c3ab9",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.12"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
